package j.framework.core;

import j.framework.domain.BaseDomain;

/**
 * User: jason
 * Date: 2014/11/10 17:01
 */
public interface EntityTrigger {
    boolean insertForBefore(ServiceContext context, BaseDomain entity);
    boolean insertForAfter(ServiceContext context, BaseDomain entity);

    boolean updateForBefore(ServiceContext context, BaseDomain entity);
    boolean updateForAfter(ServiceContext context, BaseDomain entity);

    boolean deleteForBefore(ServiceContext context, BaseDomain entity);
    boolean deleteForAfter(ServiceContext context, BaseDomain entity);

    void doException(ServiceContext context);
}
